Release 10.1A: OpenEdge Development:
Programming Interfaces
Reading XML into a ProDataSet
XML information read into a ProDataSet includes:
In this first code example, two static temp-tables are defined in an include file:
Here is a snippet of the XML file:
Note: The child records are nested within the parent records.
The code sample defines the static ProDataSet, reads the previous XML file, and reports all the orders by customer number:
This code displays a report of all the orders for each customer, like this one:
![]()
The next code sample provides a dynamic ProDataSet handle with XML Schema and data.
The output for this code is shown below:
![]()
In this sample, a handle was defined and used to create a new dynamic ProDataSet. The ProDataSet is in the
CLEARstate at this point, meaning it has no 4GL definition. When the code calls theREAD-XML()method, the method sees that XML Schema has been provided. Since the dynamic ProDataSet is in the clear state, it knows the schema is being provided to create 4GL definitions for the object from the XML Schema. If the ProDataSet had not been in theCLEARstate, the method would have know to verify the XML Schema against whatever 4GL definition existed for the ProDataSet.The method can proceed to read in the data from the XML document provided in the method call. The code displays the number of temp-tables and data-relations in the dynamic object as well as a summary of the employee records now in the
ttEmptemp-table.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |